<?php

/**
 * Input7dForecastGeoregion filter form base class.
 *
 * @package    TMD
 * @subpackage filter
 * @author     Thaihosting
 */
abstract class BaseInput7dForecastGeoregionFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IUSER_ID'           => new sfWidgetFormFilterInput(),
      'SWEATHER_TH'        => new sfWidgetFormFilterInput(),
      'SWEATHER_ENG'       => new sfWidgetFormFilterInput(),
      'SWIND_WAVE_TH'      => new sfWidgetFormFilterInput(),
      'SWIND_WAVE_ENG'     => new sfWidgetFormFilterInput(),
      'SWARNING_TH'        => new sfWidgetFormFilterInput(),
      'SWARNING_ENG'       => new sfWidgetFormFilterInput(),
      'IWEATHER_TYPE'      => new sfWidgetFormFilterInput(),
      'ITEMPERATURE_TYPE'  => new sfWidgetFormFilterInput(),
      'IWAVE_TYPE'         => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'IUSER_ID'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'SWEATHER_TH'        => new sfValidatorPass(array('required' => false)),
      'SWEATHER_ENG'       => new sfValidatorPass(array('required' => false)),
      'SWIND_WAVE_TH'      => new sfValidatorPass(array('required' => false)),
      'SWIND_WAVE_ENG'     => new sfValidatorPass(array('required' => false)),
      'SWARNING_TH'        => new sfValidatorPass(array('required' => false)),
      'SWARNING_ENG'       => new sfValidatorPass(array('required' => false)),
      'IWEATHER_TYPE'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ITEMPERATURE_TYPE'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'IWAVE_TYPE'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('input7d_forecast_georegion_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Input7dForecastGeoregion';
  }

  public function getFields()
  {
    return array(
      'DTTIME_FORECAST'    => 'Date',
      'IGEOGRAPHIC_REGION' => 'Number',
      'DTSAVE_TIME'        => 'Date',
      'IUSER_ID'           => 'Number',
      'SWEATHER_TH'        => 'Text',
      'SWEATHER_ENG'       => 'Text',
      'SWIND_WAVE_TH'      => 'Text',
      'SWIND_WAVE_ENG'     => 'Text',
      'SWARNING_TH'        => 'Text',
      'SWARNING_ENG'       => 'Text',
      'IWEATHER_TYPE'      => 'Number',
      'ITEMPERATURE_TYPE'  => 'Number',
      'IWAVE_TYPE'         => 'Number',
    );
  }
}
